package com.demo.supplier.constant;

/**
 * 业务常量类
 * 统一管理业务中使用的常量值，避免魔法数字和字符串
 * 
 * @author demo
 */
public final class BusinessConstants {

    private BusinessConstants() {
        // 私有构造函数，防止实例化
    }

    /**
     * 用户状态常量
     */
    public static final class UserStatus {
        /** 启用状态 */
        public static final Integer ENABLED = 1;
        /** 禁用状态 */
        public static final Integer DISABLED = 0;
    }

    /**
     * 供应商状态常量
     */
    public static final class SupplierStatus {
        /** 启用状态 */
        public static final Integer ENABLED = 1;
        /** 禁用状态 */
        public static final Integer DISABLED = 0;
    }

    /**
     * 文件相关常量
     */
    public static final class File {
        /** 文件大小限制（5MB，单位：字节） */
        public static final long MAX_FILE_SIZE = 5 * 1024 * 1024;
        /** 支持的图片格式 */
        public static final String[] IMAGE_EXTENSIONS = {"jpg", "jpeg", "png", "gif", "bmp"};
        /** 支持的文档格式 */
        public static final String[] DOCUMENT_EXTENSIONS = {"pdf", "doc", "docx", "xls", "xlsx", "txt"};
    }

    /**
     * 响应状态码常量
     */
    public static final class ResponseCode {
        /** 成功 */
        public static final Integer SUCCESS = 200;
        /** 业务异常 */
        public static final Integer BUSINESS_ERROR = 400;
        /** 未授权 */
        public static final Integer UNAUTHORIZED = 401;
        /** 禁止访问 */
        public static final Integer FORBIDDEN = 403;
        /** 资源不存在 */
        public static final Integer NOT_FOUND = 404;
        /** 服务器内部错误 */
        public static final Integer INTERNAL_ERROR = 500;
    }

    /**
     * Redis Key 前缀常量
     */
    public static final class RedisKey {
        /** 用户登录token前缀 */
        public static final String USER_LOGIN = "user:login:";
        /** 用户信息缓存前缀 */
        public static final String USER_INFO = "user:info:";
        /** 供应商信息缓存前缀 */
        public static final String SUPPLIER_INFO = "supplier:info:";
        /** 文件信息缓存前缀 */
        public static final String FILE_INFO = "file:info:";
    }

    /**
     * JWT 相关常量
     */
    public static final class Jwt {
        /** Token 前缀 */
        public static final String TOKEN_PREFIX = "Bearer ";
        /** 用户ID声明名 */
        public static final String CLAIM_USER_ID = "userId";
        /** 用户名声明名 */
        public static final String CLAIM_USERNAME = "username";
    }

    /**
     * 日志操作类型常量
     */
    public static final class LogOperation {
        /** 创建 */
        public static final String CREATE = "CREATE";
        /** 更新 */
        public static final String UPDATE = "UPDATE";
        /** 删除 */
        public static final String DELETE = "DELETE";
        /** 查询 */
        public static final String QUERY = "QUERY";
        /** 登录 */
        public static final String LOGIN = "LOGIN";
        /** 登出 */
        public static final String LOGOUT = "LOGOUT";
    }

    /**
     * 删除标记常量
     */
    public static final class DeleteFlag {
        /** 未删除 */
        public static final Integer NOT_DELETED = 0;
        /** 已删除 */
        public static final Integer DELETED = 1;
    }

    /**
     * 分页默认值常量
     */
    public static final class Page {
        /** 默认页码 */
        public static final int DEFAULT_CURRENT = 1;
        /** 默认每页大小 */
        public static final int DEFAULT_SIZE = 10;
        /** 最大每页大小 */
        public static final int MAX_SIZE = 100;
    }

    /**
     * 供应商信用等级常量
     */
    public static final class CreditRating {
        /** AAA级 */
        public static final String AAA = "AAA";
        /** AA级 */
        public static final String AA = "AA";
        /** A级 */
        public static final String A = "A";
        /** B级 */
        public static final String B = "B";
        /** C级 */
        public static final String C = "C";
    }
}